home *** CD-ROM | disk | FTP | other *** search
/ s-gikan2.maizuru-ct.ac.jp / s-gikan2.maizuru-ct.ac.jp.zip / s-gikan2.maizuru-ct.ac.jp / pub / ncvc352a_install.exe / {app} / scripts / change_XZ_YX.pl < prev    next >
Perl Script  |  2004-04-02  |  467b  |  29 lines

  1. #! /usr/bin/perl
  2.  
  3. # NCVCé┼ì∞ɼé╡é╜GâRü[âhé≡üANCÉ∙ö╒ùpé╔Ä▓ò╧è╖é╖éΘâXâNâèâvâg #
  4.  
  5.  
  6. %XY= ("X","Z","Y","X","I","K","J","I");
  7.  
  8. $pre_file= $ARGV[0];
  9. $out_file= $ARGV[1];
  10. open(IN,$pre_file);
  11. open(OUT,">$out_file");
  12.  
  13. while(<IN>){
  14.     if(!/^N?[0-9\s]*[\(\%]/){
  15.         if(/[XYIJ]/){
  16.             $new_line= "";
  17.             while(/([XYIJ])([0-9\-\.]+)/){
  18.                 $new_line= $new_line.$`.$XY{$1}.$2;
  19.                 $_= $';
  20.             }
  21.             $_= $new_line.$_;
  22.         }
  23.     }
  24.     print OUT;
  25. }
  26.  
  27. close(OUT);
  28. close(IN);
  29.